﻿using Serilog;
using System;
using System.Net.Http;
using System.Threading.Tasks;

namespace Serilog_Test2
{
    class Program
    {
        //https://docs.datalust.co/docs/getting-started
        static void Main(string[] args)
        {
            var expr = "@Level = 'Information' and AppId is not null and Items[?] like 'C%'";


            Log.Logger = new LoggerConfiguration()
             .WriteTo.Console()
            //.WriteTo.Seq("http://localhost:5341")
            .Enrich.WithProperty("AppId", 10)
            .Filter.ByIncludingOnly(expr)
             .CreateLogger();

            Log.Information("Hello, {Name}!", Environment.UserName);

            Log.Error("Hello, {Name}!!", Environment.UserName);


            Log.Information("Cart contains {@Items}", new[] { "Tea", "Coffee" });
            Log.Warning("Cart contains {@Items}", new[] { "Tea", "Coffee" });
            Log.Information("Cart contains {@Items}", new[] { "Apricots" });
            Log.Information("Cart contains {@Items}", new[] { "Peanuts", "Chocolate" });




            Log.CloseAndFlush();

            Console.ReadKey(true);
        }
    }
}
